package com.leyou.auth;

import com.leyou.auth.constants.JwtConstants;

import javax.servlet.http.Cookie;
import javax.servlet.http.HttpServletResponse;

public class DeleteCookie {
    public static void deleteCookieForResponse(HttpServletResponse response){
        Cookie cookie = new Cookie(JwtConstants.COOKIE_NAME, "");

        cookie.setDomain(JwtConstants.DOMAIN);
        cookie.setMaxAge(0);
        cookie.setPath("/");
        cookie.setHttpOnly(true);

        response.addCookie(cookie);
    }
}
